package com.vca.front.controller;

import com.vca.common.response.AboutAdminResponse;
import com.vca.common.response.AboutFrontResponse;
import com.vca.common.result.CommonResult;
import com.vca.service.service.SystemGroupDataService;
import com.vca.service.service.VcaAboutService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author Li
 * @program VCA_Mini_Program
 * @description 关于我们控制器
 * @classname VcaAboutController
 * @since 2022/12/09 14:15:58
 **/

@Slf4j
@RestController("VcaAboutController")
@RequestMapping("api/front/about")
@Api(tags = "关于我们控制器")
public class VcaAboutController {

    @Autowired
    private VcaAboutService vcaAboutService;

    @Autowired
    private SystemGroupDataService systemGroupDataService;

    /**
     * @description 获取关于列表和配置信息
     * @author Li
     * @date 2022/12/15 15:39
     * @return com.vca.common.result.CommonResult
     */
    @ApiOperation(value = "获取关于列表和配置信息")
    @GetMapping("/get")
    public CommonResult getAbout(@RequestHeader(value = "language",required = false) String language){
        return CommonResult.success(vcaAboutService.getFrontAboutAndConfig(language));
    }

    /**
     * @description 获取关于配置信息和关于列表
     * @author Li
     * @date 2022/12/9 14:20
     * @return com.vca.common.result.CommonResult
     */
//    @ApiOperation(value = "关于列表")
//    @GetMapping("/list")
//    public CommonResult<List<AboutFrontResponse>> list(){
//        return CommonResult.success(vcaAboutService.getFrontList());
//    }

    /**
     * @description  常见问题
     * @author Li
     * @date 2022/12/9 15:13
     * @return com.vca.common.result.CommonResult
     */
    @ApiOperation(value = "常见问题")
    @GetMapping("/fqa")
    public CommonResult getFqa(@RequestHeader(value = "language",required = false) String language){
        return CommonResult.success(systemGroupDataService.getFqa(language));
    }

    @ApiOperation("隐私条款")
    @GetMapping("/privacyPolicy")
    public CommonResult getPrivacyPolicy(@RequestHeader(value = "language",required = false) String language){
        return CommonResult.success(systemGroupDataService.getPrivacyPolicy(language));
    }

    /**
    * @description  条款细则
    * @author Li
    * @date 2023/2/16 11:06
    * @return {@link CommonResult}
    */
    @ApiOperation("条款细则")
    @GetMapping("/termsConditions")
    public CommonResult getTermsConditions(@RequestHeader(value = "language",required = false) String language){
        return CommonResult.success(systemGroupDataService.getTermsConditions(language));
    }


    /**
     * @description  根据id获取关于信息
     * @methodName getAbout
     * @param id
     * @author Li
     * @date 2023/1/9 9:27
     * @return {@link CommonResult}<{@link AboutFrontResponse}>
     */
    @ApiOperation("根据id获取关于信息")
    @GetMapping("/getAbout")
    public CommonResult<AboutFrontResponse> getAbout(@RequestHeader(value = "language",required = false) String language, Long id){
        return CommonResult.success(vcaAboutService.getFrontAbout(language,id));
    }

    /**
    * @description 生辰石列表
    * @author Li
    * @date 2023/6/9 10:12
    * @return {@link CommonResult}<{@link Map}<{@link String},{@link Object}>>
    */
    @ApiOperation("生辰石")
    @GetMapping("/birthstone")
    public CommonResult<Map<String,Object>> birthstone(@RequestHeader(value = "language",required = false) String language) {
        return CommonResult.success(systemGroupDataService.birthstone(language));
    }

}
